Home | | Latest | About | Random
# Week 2 Tuesday 6/27 brief notes.
Reading: Finish reading 6.6, 6.7. Read 7.4.
Last time we dealt with integrals of the form $\int \frac{1}{\text{quadratic}}$ and $\int \frac{1}{\sqrt{\text{quadratic}}}$, using inverse trigonometric and inverse hyperbolic functions. To remind you again here they are:
(1) $\int \frac{1}{1+x^2} dx = \arctan(x)+C$
(2) $\int \frac{1}{1-x^2}dx=\begin{cases}\operatorname{arctanh}(x)+C & \text{if }|x|<1 \\ \operatorname{arccoth}(x)+C & \text{if } |x|>1\end{cases}$
(3) $\int \frac{1}{\sqrt{1+x^2}}dx=\operatorname{arcsinh}(x)+C$
(4) $\int \frac{1}{\sqrt{1-x^2}}dx = \arcsin(x)+C \quad \text{if }|x| < 1$
(5) $\int \frac{1}{\sqrt{x^2-1}} dx = \begin{cases} \operatorname{arccosh}(x) + C & \text{if } x > 1\\ -\operatorname{arccosh}(-x) & \text{if } x < -1\end{cases}$
Some of them are a bit unwieldy to write, and have alternate expressions that we will see soon.
Today's goal is to deal with all antiderivatives with rational function integrands, namely $\int \frac{\text{polynomial}}{\text{polynomial}}$. The technique will be **partial fraction decompositions** (7.4). The idea is to breakdown a rational function into simpler pieces by long division and partial fraction decomposition. Then each piece will either be polynomial, $\frac{1}{\text{linear}}$, or $\frac{1}{\text{quadratic}}$, which we know how to deal with.
## Important warm-up: $\int \frac{\text{linear}}{\text{quadratic}}$ case.
Some more practice. With a little bit of more work, we can actually find $\int \frac{\text{linear}}{\text{quadratic}}$!
Example. Find $\displaystyle \int \frac{3x}{x^2+4x+20}dx$.
$\blacktriangleright$ Note this almost look like $\int \frac{1}{\text{quadratic}}$, but not quite. Let us compete the square first anyway, and try to keep the "right pattern" by **borrowing**. We get $$
\begin{align*}
\int \frac{3x}{x^2+4x+20}dx & =\int \frac{3x}{(x+2)^2+16}dx \\
& =\int \frac{3(x+2-2)}{(x+2)^2+16}dx \\
& = \underbrace{\int \frac{3(x+2)}{(x+2)^2 + 16} dx}_{(A)} - \underbrace{\int\frac{6}{(x+2)^2+16}dx}_{(B)} \\
\end{align*}
$$So now we have two integrals to compute, $(A)$ and $(B)$. The first one will be a simple substitution, since we have the derivative available, while the second one will be arctan.
Indeed, for $(A)$, let $w=(x+2)^2+16$, then $dw=2(x+2)dx$, hence $$
\begin{align*}
(A) & =\int \frac{3(x+2)}{(x+2)^2+16}dx \\
& =\int \frac{3}{w} \frac{dw}{2} \\
& =\frac{3}{2}\ln|w|+C \\
& =\frac{3}{2}\ln|(x+2)^2+16|+C
\end{align*}
$$
And for $(B)$ we have $$
\begin{align*}
(B) & = \int \frac{6}{(x+2)^2+16}dx \\
& = \frac{6}{16} \int \frac{1}{1+ \frac{(x+2)^2}{16}}dx \quad \text{, let }u=\frac{x+2}{4}, du=\frac{dx}{4}\\
& = \frac{6}{16} \int \frac{1}{1+u^2} 4du \\
& =\frac{3}{2} \arctan(u)+C \\
& =\frac{3}{2}\arctan\left( \frac{x+2}{4} \right)+C
\end{align*}
$$
So putting together everything, $(A)-(B)$, we have $$
\int \frac{3x}{x^2+4x+20}dx=\frac{3}{2}\ln|(x+2)^2+16|-\frac{3}{2}\arctan\left( \frac{x+2}{4} \right)+C.\,\blacklozenge
$$
## Polynomial long division.
If we have a rational function $\frac{\text{polynomial}}{\text{polynomial}}$, if the degree of the numerator is greater than or equal to the degree of the denominator, then we can use long division to rewrite as $\text{quotient} + \frac{\text{remainder}}{\text{divisor}}$.
**Example.**
Rewrite the rational function $\displaystyle \frac{6x^4-10x^3+17x^2 -20x+6}{2x^2+5}$ in the quotient-remainder form.
$\blacktriangleright$ $$
\begin{array}{}
& & 3x^2 & -5x & +1 \\\hline
2x^2+5 & | & 6x^4 & -10x^3 & +17x^2 & -20x & +6 \\
&-)& 6x^4 & & +15x^2 \\\hline
& & & -10x^3 & +2x^2 & -20x & +6 \\
& & -) & -10x^3 & & -25x \\\hline
& & & & 2x^2 & +5x & +6 \\
& & & -) & 2x^2 & & +5 \\\hline
& & & & & 5x & +1
\end{array}
$$So we get$$
3x^2-5x+1 + \frac{5x +1}{2x^2+5}. \quad\blacklozenge
$$
This allows us to integrate the whole thing in fact.
Example. Find $$
\int \frac{6x^4-10x^3+17x^2 -20x+6}{2x^2+5} dx
$$
$\blacktriangleright$ By polynomial long division, we can re-write it as
$$
\int \frac{6x^4-10x^3+17x^2 -20x+6}{2x^2+5}dx =\int 3x^2-5x+1 + \frac{5x +1}{2x^2+5}dx
$$
This gives two parts, one is integrating a polynomial, the other integrating some $\frac{\text{linear}}{\text{quadratic}}$.
The polynomial part is straightforward, $\displaystyle \int 3x^2-5x+1 \, dx= x^3 - \frac{5}{2}x^2 + x+C$.
For the other part we will be clever like in the warm-up. Since the denominator is already in "$1+u^2$" form, we do not need to complete the square. So, $$
\begin{align*}
\int \frac{5x+1}{2x^2+5}dx & =\underbrace{\int \frac{5x}{2x^2+5}dx}_{\text{let }w=2x^2+5,\,dw=4xdx}+\int \frac{1}{2x^2+5}dx \\
& = \int \frac{5}{w} \frac{dw}{4}+ \frac{1}{5} \underbrace{\int \frac{1}{1+ \frac{2x^2}{5}}dx}_{\text{let }u= \sqrt{\frac{2}{5}}x,\,du=\sqrt{\frac{2}{5}}dx} \\
& = \frac{5}{4}\ln|w| + \frac{1}{5} \int \frac{1}{1+u^2} \sqrt{\frac{5}{2}} du \\
& = \frac{5}{4}\ln|2x^2+5| + \frac{1}{\sqrt{10}}\arctan(u)+C \\
& = \frac{5}{4}\ln|2x^2+5| + \frac{1}{\sqrt{10}}\arctan\left( \sqrt{\frac{2}{5}}x \right)+C
\end{align*}
$$Finally, putting everything together,
$$
\begin{align*}
& \int \frac{6x^4-10x^3+17x^2 -20x+6}{2x^2+5}dx \\
& =\int 3x^2-5x+1 + \frac{5x +1}{2x^2+5}dx \\
& =x^3 - \frac{5}{2}x^2 + x +\frac{5}{4}\ln|2x^2+5| + \frac{1}{\sqrt{10}}\arctan\left( \sqrt{\frac{2}{5}}x \right)+C. \quad\blacklozenge
\end{align*}
$$
## Partial fraction decomposition (pfd). (7.4)
So far this is great, we can deal with $\int \frac{\text{polynomial}}{\text{quadratic}}$. But what about general rational functions as integrand, $\frac{\text{polynomial}}{\text{polynomial}}$? The idea is that every rational function can be decomposed as a sum of polynomial and fractions where the denominator is either linear or quadratic, or powers of them. This process is called **partial fraction decomposition**.
This is based on the main principle that
> **Real fundamental theorem of algebra.**
> Every real polynomial $p(x)$ can be factored as a product of the form $p(x)=f_1(x)^{m_1}f_2(x)^{m_2}\cdots f_k(x)^{m_k}$, where each $f_i(x)$ is a distinct linear polynomial or irreducible quadratic, raised to some power $m_i$.
**Remark.** It does take some work to actually find this factorization, and sometimes not so easy. However the cases we will encounter you can factor them reasonably.
**Remark 2.** If we allow complex numbers, then every complex polynomials (including real ones) can be factored completely into distinct linear polynomials, raised to some power. This is called the **fundamental theorem of algebra.**
Here is how to find the decomposition.
> **Partial fraction decomposition (pfd).** Simple case: Non-repeating linear factors.
> Consider a rational function of the form $\frac{p(x)}{q(x)}$ where degree of $p$ is strictly less than the degree of $q$, and suppose the leading coefficient of $q$ is $1$ (so $q$ is **monic**, we say). If $q(x)$ has factorization $q(x)=(x-r_1)(x-r_2)\cdots (x-r_k)$, where $(x-r_i)$ are **distinct** linear factors. Then $\frac{p(x)}{q(x)}$ can be expressed as $$
\frac{p(x)}{q(x)}=\frac{A_1}{x-r_1} + \frac{A_2}{x-r_2}+\cdots+ \frac{A_k}{x-r_k}
$$ for some coefficients $A_i$. These coefficients can be found by adding the fraction back together and match terms with the denominator $p(x)$.
**Example.** Find $$
\int \frac{3x+1}{x^2+5x+6}dx
$$
$\blacktriangleright$ Note the denominator factors as $x^2+5x+6=(x+2)(x+3)$, so by pfd we have $$
\frac{3x+1}{x^2+5x+6}= \frac{A}{x+2} + \frac{B}{x+3}
$$To find what $A,B$ are, we need to make the equality true. So by cross multiplying, $$
\frac{A(x+3)+B(x+2)}{x^2+5x+6}= \frac{3x+1}{x^2+5x+6}
$$hence $$
A(x+3) + B(x+2) = 3x+1
$$
Two ways of solving $A,B$ here.
**Matching powers way.** Multiply everything out and collect like powers of $x$. I will write $[x^k]$ to denote the coefficients of the terms in front of $x^k$. So
$$
\begin{align*}
[x^1]: & A+B =3 \\
[x^0]: & 3A+2B =1
\end{align*}
$$So we just need $B=8$ and $A=-5$.
**Clever substitution way.** Note if we let $x=-3$, then we get the equation $0+B(-1)=-9+1=-8$, so $B=8$. Similarly by letting $x=-2$, we have $A=3(-6)+1=-5$.
In any case, you can plug in any $x$ so long as making you solve for the coefficients $A,B$ easily.
Hence $\displaystyle \frac{3x+1}{x^2+5x+6}= -\frac{5}{x+2} + \frac{8}{x+3}$. And this is easy to integrate! Each is just some natural logarithm (you can see it with a quick $u$-sub on each term). So, $$
\begin{align*}
\int \frac{3x+1}{x^2+5x+6} dx & = \int \frac{-5}{x+2}+\frac{8}{x+3}dx\\
&=-5\ln|x+2|+8\ln|x+3|+C. \quad\blacklozenge
\end{align*}
$$
## Irreducible quadratic factors in pfd.
What if the factorization of the denominator has a quadratic factor $ax^2+bx+c$ that is **irreducible**? That is, you cannot factor it over the reals (equivalently, with negative **discriminant** $\Delta=b^2-4ac < 0$). Then the modification is the following:
> **Irreducible factor in pfd.**
> If instead the rational function $\frac{p(x)}{q(x)}$ where $q(x)$ has only distinct factors but some of them are irreducible quadratic, say $x^2+bx+c$. Then the corresponding fraction in the decomposition is $\displaystyle \frac{Ax+B}{x^2+bx+c}$ instead. Notice a linear term on top.
**Example.** Find $$
\int \frac{x+2}{x^3-1}dx
$$
$\blacktriangleright$ Note we factor $x^3-1=(x-1)(x^2+x+1)$, where the quadratic is irreducible (this factorization can be found by first noting $x=1$ is a root, and perform long division to factor).
So by pfd, $$
\frac{x+2}{x^3-1}= \frac{A}{x-1}+\frac{Bx+C}{x^2+x+1}
$$
The coefficients $A,B,C$ can be found using **both methods** at once. If we cross multiply, we need $A(x^2+x+1)+(Bx+C)(x-1)=x+2$, which gives the following system of equations $$
\begin{matrix}
[x^2]: & A+B & =0 \\
[x^1]: & A-B+C & =1 \\
[x^0]: & A-C & =2
\end{matrix}
$$
And before we jump into the system, note by **substituting** $x=1$ we just get $A(3)=3$, so $A=1$. Hence using the system we get $C=-1$, $B=-1$. So, $$
\frac{x+2}{x^3-1}= \frac{1}{x-1} - \frac{x+1}{x^2+x+1}
$$
Note now if we are to integrate each term, the first one is just some natural log, and the second is $\frac{\text{linear}}{\text{quadratic}}$ which we know how to do! Let us do it.
$$
\int \frac{1}{x-1}dx=\ln|x-1|+C
$$
and
$$
\begin{align*}
\int \frac{x+1}{x^2+x+1}dx & =\int \frac{x+1}{\left( x+\frac{1}{2} \right)^2+\frac{3}{4}}dx \\
& = \int \frac{x+\frac{1}{2}-\frac{1}{2}+1}{\left( x+\frac{1}{2} \right)^2+\frac{3}{4}}dx \\
&= \underbrace{\int \frac{\left( x+\frac{1}{2} \right)}{\left( x+\frac{1}{2} \right)^2+\frac{3}{4}} dx}_{w=\left( x+\frac{1}{2} \right)^2+\frac{3}{4}, \, dw=2\left( x+\frac{1}{2}\right)dx}+\int \frac{\frac{1}{2}}{\left( x+\frac{1}{2} \right)^2+\frac{3}{4}}dx \\
& =\int \frac{1}{w} \frac{dw}{2}+ \frac{\frac{1}{2}}{\frac{3}{4}}\underbrace{\int \frac{1}{\frac{4}{3}\left( x+\frac{1}{2} \right)^2+ 1}dx}_{u=\sqrt{\frac{4}{3}}\left( x+\frac{1}{2} \right), \, du=\sqrt{\frac{4}{3}}dx} \\
& =\frac{1}{2}\ln|w| + \frac{2}{3} \int \frac{1}{u^2+1} \sqrt{\frac{3}{4}}du \\
& =\frac{1}{2} \ln\left|\left( x+\frac{1}{2} \right)^2 +\frac{3}{4}\right| +\frac{1}{\sqrt{3}} \arctan(u)+C \\
& =\frac{1}{2} \ln\left|\left( x+\frac{1}{2} \right)^2 +\frac{3}{4}\right| +\frac{1}{\sqrt{3}} \arctan\left(\sqrt{\frac{4}{3}}\left( x+\frac{1}{2} \right)\right)+C
\end{align*}
$$
Finally, the overall integral is the difference of these two, so we get $$
\ln|x-1| - \frac{1}{2} \ln\left|\left( x+\frac{1}{2} \right)^2 +\frac{3}{4}\right| - \frac{1}{\sqrt{3}} \arctan\left(\sqrt{\frac{4}{3}}\left( x+\frac{1}{2} \right)\right) +C. \quad\blacklozenge
$$
Whew!
## Repeated factors.
Finally, what if we have repeated factors in the denominator? Then we need to consider a **staircase** of terms up to that power:
> **Repeated factor in pfd.**
> Suppose rational function $\frac{p(x)}{q(x)}$ is such that the denominator $q(x)$ has a linear or irreducible quadratic factor $f(x)$ that repeated $m$ times. Then in the partial fraction of $\frac{p(x)}{q(x)}$, we need to consider the staircase sum $\frac{A_1}{f(x)} + \frac{A_2}{f(x)^2}+\cdots+ \frac{A_k}{f(x)^k}$ $f(x)$ is linear, or $\frac{A_1x+B_1}{f(x)} + \frac{A_2x+B_2}{f(x)^2}+\cdots+ \frac{A_kx+B_k}{f(x)^k}$ if $f(x)$ is irreducible quadratic. Notice the staircase only happens in the denominator, and not the numerator, and the coefficients could all be different.
**Example.** Find $$
\int \frac{1}{(x-1)(x+1)^3 }dx
$$
$\blacktriangleright$ The denominator is already factored, so by pfd, we have $$
\frac{1}{(x-1)(x+1)^3 } = \frac{A}{x-1} + \frac{B}{x+1}+\frac{C}{(x+1)^2}+\frac{D}{(x+1)^3}
$$
After finding the coefficients $A,B,C,D$, note that the $A,B$ terms are just natural logarithms, while $C,D$ terms can be done by simple substitution, and giving powers. ///